import network import socket from time import time station = network.WLAN(network.STA_IF) # Konfiguration des Network-Interfaces station.active(True) station.connect('mipa_devolo', 'asdfghjkl1234') # hier Ihre Wlan-Daten eintragen! time0 = time() while (station.isconnected() == False) and (time() - time0 < 5): pass if station.isconnected(): print('Wlan connected') print(station.ifconfig()) # zur Information server_addr = ('time.fu-berlin.de', 13) client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect(server_addr) print('Socket connected') data = client.recv(1024) # max. Anz. der Bytes print(str(data,'UTF-8')) client.close() print('Socket closed') station.active(False) print('Wlan deactivated')